using System;
using Windy.Transformations;
using Windy.TurtleDrawing;

namespace Windy.DragonCurve.Models.Schemes
{
    public static class DragonCurvePlotRules
    {
        public static readonly ITransformRule<Symbols>[] IngnoreVariablePlotingRules = new ITransformRule<Symbols>[]
		        {
		            new BlockTransformRule<Symbols>((s)=>s.IsVariableSymbol()),
		            new ReplaceTransformRule<Symbols, Symbols, Action<DragonCurve, Turtle>>(Symbols.F,DrawActions.StepForward),
		            new ReplaceTransformRule<Symbols, Symbols, Action<DragonCurve, Turtle>>(Symbols.Plus,DrawActions.TurnLeft),
		            new ReplaceTransformRule<Symbols, Symbols, Action<DragonCurve, Turtle>>(Symbols.Minus,DrawActions.TurnRight),
		        };

        public static readonly ITransformRule<Symbols>[] PlotingVariablePlotingRules = new ITransformRule<Symbols>[]
                {
                     new ReplaceTransformRule<Symbols, Symbols, Action<DragonCurve, Turtle>>((s)=>s.IsVariableSymbol() || s == Symbols.F,DrawActions.StepForward),
		             new ReplaceTransformRule<Symbols, Symbols, Action<DragonCurve, Turtle>>(Symbols.Plus,DrawActions.TurnLeft),
		             new ReplaceTransformRule<Symbols, Symbols, Action<DragonCurve, Turtle>>(Symbols.Minus,DrawActions.TurnRight),
                };
    }
}
